#!/bin/bash
# replace wrong links with correct ones
export PATH=/bin:$PATH

cd zlibrary/core/include
rm *.h
ln ../src/util/allocator.h allocator.h
ln ../src/util/shared_ptr.h shared_ptr.h
ln ../src/application/ZLApplication.h ZLApplication.h
ln ../src/util/ZLBoolean3.h ZLBoolean3.h
ln ../src/util/ZLColor.h ZLColor.h
ln ../src/dialogs/ZLDialog.h ZLDialog.h
ln ../src/dialogs/ZLDialogContent.h ZLDialogContent.h
ln ../src/dialogs/ZLDialogManager.h ZLDialogManager.h
ln ../src/filesystem/ZLDir.h ZLDir.h
ln ../src/encoding/ZLEncodingConverter.h ZLEncodingConverter.h
ln ../src/filesystem/ZLFile.h ZLFile.h
ln ../src/image/ZLFileImage.h ZLFileImage.h
ln ../src/filesystem/ZLFileInfo.h ZLFileInfo.h
ln ../src/library/ZLibrary.h ZLibrary.h
ln ../src/image/ZLImage.h ZLImage.h
ln ../src/image/ZLImageManager.h ZLImageManager.h
ln ../src/filesystem/ZLInputStream.h ZLInputStream.h
ln ../src/application/ZLKeyBindings.h ZLKeyBindings.h
ln ../src/language/ZLLanguageDetector.h ZLLanguageDetector.h
ln ../src/language/ZLLanguageList.h ZLLanguageList.h
ln ../src/message/ZLMessage.h ZLMessage.h
ln ../src/dialogs/ZLOptionEntry.h ZLOptionEntry.h
ln ../src/options/ZLOptions.h ZLOptions.h
ln ../src/dialogs/ZLOptionsDialog.h ZLOptionsDialog.h
ln ../src/filesystem/ZLOutputStream.h ZLOutputStream.h
ln ../src/view/ZLPaintContext.h ZLPaintContext.h
ln ../src/resources/ZLResource.h ZLResource.h
ln ../src/runnable/ZLRunnable.h ZLRunnable.h
ln ../src/util/ZLSearchUtil.h ZLSearchUtil.h
ln ../src/dialogs/ZLSelectionDialog.h ZLSelectionDialog.h
ln ../src/splittedView/ZLSplittedView.h ZLSplittedView.h
ln ../src/image/ZLStreamImage.h ZLStreamImage.h
ln ../src/util/ZLStringUtil.h ZLStringUtil.h
ln ../src/time/ZLTime.h ZLTime.h
ln ../src/util/ZLUnicodeUtil.h ZLUnicodeUtil.h
ln ../src/view/ZLView.h ZLView.h
ln ../src/xml/ZLXMLReader.h ZLXMLReader.h
ln ../src/xml/ZLXMLWriter.h ZLXMLWriter.h
ln ../src/filesystem/zip/ZLZDecompressor.h ZLZDecompressor.h

cd optionEntries
rm *.h
ln ../../src/optionEntries/ZLColorOptionBuilder.h ZLColorOptionBuilder.h
ln ../../src/optionEntries/ZLFontFamilyOptionEntry.h ZLFontFamilyOptionEntry.h
ln ../../src/optionEntries/ZLLanguageOptionEntry.h ZLLanguageOptionEntry.h
ln ../../src/optionEntries/ZLSimpleKeyOptionEntry.h ZLSimpleKeyOptionEntry.h
ln ../../src/optionEntries/ZLSimpleOptionEntry.h ZLSimpleOptionEntry.h
ln ../../src/optionEntries/ZLStringInfoEntry.h ZLStringInfoEntry.h
ln ../../src/optionEntries/ZLToggleBooleanOptionEntry.h ZLToggleBooleanOptionEntry.h

cd ../../../text/include
rm *.h
ln ../src/view/ZLChineseBreakingAlgorithm.h ZLChineseBreakingAlgorithm.h
ln ../src/model/ZLTextAlignmentType.h ZLTextAlignmentType.h
ln ../src/view/ZLTextArea.h ZLTextArea.h
ln ../src/view/ZLTextElement.h ZLTextElement.h
ln ../src/hyphenation/ZLTextHyphenator.h ZLTextHyphenator.h
ln ../src/model/ZLTextKind.h ZLTextKind.h
ln ../src/model/ZLTextMark.h ZLTextMark.h
ln ../src/model/ZLTextModel.h ZLTextModel.h
ln ../src/model/ZLTextParagraph.h ZLTextParagraph.h
ln ../src/view/ZLTextParagraphCursor.h ZLTextParagraphCursor.h
ln ../src/model/ZLTextRowMemoryAllocator.h ZLTextRowMemoryAllocator.h
ln ../src/view/ZLTextSelectionModel.h ZLTextSelectionModel.h
ln ../src/view/ZLTextStyle.h ZLTextStyle.h
ln ../src/view/ZLTextStyleOptions.h ZLTextStyleOptions.h
ln ../src/hyphenation/ZLTextTeXHyphenator.h ZLTextTeXHyphenator.h
ln ../src/view/ZLTextView.h ZLTextView.h
ln ../src/view/ZLTextWord.h ZLTextWord.h

cd ../../ui/src/nanox
rm application-lbook
rm application-lbook.lnk
ln -s application-desktop application-lbook